package com.elesyser.util;

import android.text.format.Time;

public class Date {
	private String semestor;
	private String academicYear;
	private int Today;

	public Date(){
		Time time = new Time();
    	time.setToNow();
    	Integer year = time.year;
    	int month = time.month;
    	
    	setSemestor("");
    	setAcademicYear("");
    	if(month < 9){
    		setAcademicYear(Integer.toString(year-1) +"-" +year.toString());
    	}
    	else{
    		setAcademicYear(year.toString() + "-" + Integer.toString(year + 1));
    	}
    	
    	if(month <2 || month >= 9){
    		setSemestor("1");
    	}
    	else {
			setSemestor("2");
		}
    	setToday(time.weekDay == 0 ? 7 : time.weekDay) ;
	}

	public void setSemestor(String semestor) {
		this.semestor = semestor;
	}

	public String getSemestor() {
		return semestor;
	}

	public void setAcademicYear(String academicYear) {
		this.academicYear = academicYear;
	}

	public String getAcademicYear() {
		return academicYear;
	}

	public void setToday(int today) {
		Today = today;
	}

	public int getToday() {
		return Today;
	}
}
